package com.ant.storage.controller;

import com.ant.storage.common.ResultVo;
import com.ant.storage.dto.CnxjrjzDto;
import com.ant.storage.pojo.Cnaccount;
import com.ant.storage.service.ICnaccountService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author  hzd
 * @date  2024/7/9 10:37
 * @version 1.0
 */

@RestController
@RequestMapping("/cnaccount")
@Api(tags = "城市信息接口")
public class CnaccountController {


    @Autowired
    private ICnaccountService cnaccountService;

    @ApiOperation(value = "查看城市")
    @GetMapping("/queryCnaccount")
    public ResultVo queryCnaccount(CnxjrjzDto dto) throws Exception {
        return ResultVo.success("操作成功", cnaccountService.getList(dto));
    }


    @ApiOperation(value = "查看城市")
    @PostMapping("/saveCnaccount")
    public ResultVo saveCnaccount(@RequestBody Cnaccount cnaccount){
        cnaccountService.save(cnaccount);
        return ResultVo.success("操作成功");
    }

}
